<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.org/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximumscale=1">
    <title>layui布局</title>
    <!--第一步，引入layui的资源-->
    <link rel="stylesheet" th:href="@{/resources/layui/css/layui.css}">
</head>
<body>
<input type="hidden" id="uid" >
<div class="layui-inline" >
    <select id="vehicleid">
        <option value="0">请选择</option>
    </select>
</div>

当前用户等级还未派发的车辆：<input id="aa" style="border: none ;width: 20px"> 辆

<!--在body下引入js资源-->
<script th:src="@{/resources/layui/layui.js}"></script>

<!--开始写，layui的资源-->
<script th:inline="none">//此处有坑，需要设置“th:inline="none"”
//一般直接写在一个js文件中
//同时，在layui中引入table表格

layui.use(['layer', 'form', 'table'], function () {
    var layer = layui.layer
        , form = layui.form
        , table = layui.table
        , $ = layui.jquery;

    $.ajax({
        url:"/apply/auditIsInfo",
        type:"get",
        data:{uid:$("#uid").val()},
        success:function (res){
           var num=res.data.vehiclefilesList.length;
            $("#aa").val(num);
            var vehiclefilesList=res.data.vehiclefilesList;
            if(vehiclefilesList.length>0){
                for(var i=0;i<vehiclefilesList.length;i++){
                    var vehicle=vehiclefilesList[i];
                    $("#vehicleid").append("<option value='"+vehicle.id+"'>"+vehicle.vehiclenum+"</option> ")
                }
            }
            //渲染下拉菜单 下拉菜单都必须得渲染
            layui.form.render("select");
        }
    })


});


var callbackdata=function(){
    //var checkStatus = layui.table.checkStatus('applyList');
    //返回值没有data的话父页面拿不到id的值

    var userId=document.getElementById('uid').value;
    var vehicleid=document.getElementById('vehicleid').value;
    var obj={
        id:userId,
        vehicleid:vehicleid
    }
    return obj;
}
    //引入jquery
</script>
</body>
</html>